function App() {
  // 事件处理函数-箭头函数形式的类型注解
  const changeHandler: React.ChangeEventHandler<HTMLInputElement> = (e) => {
    console.log(e.target.value)
  }

  const clickHandler: React.MouseEventHandler<HTMLButtonElement> = (e) => {
    console.log(e.target)
  }

  return (
    <div>
      <input type="text" onChange={changeHandler} />
      {/* 需要类型注解 */}
      <button onClick={clickHandler}></button>
      {/* 不需要类型注解 */}
      <button onClick={(e) => console.log(e.currentTarget)}></button>
    </div>
  )
}
